<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>
        function query(){
            // 获取页面中的元素
            // var obj = document.getElementById('hello')
            // console.log(typeof obj) // DOM对象
            // console.log(obj)

            var objs = document.getElementsByName('world')
            console.log(objs)
            console.log(objs[1])
        }
    </script>
</head>
<body>
    <input type="button" value="按钮1" onclick="query()">
    <button>按钮2</button>
    <hr>

    <div id="hello">嘿嘿</div>
    <p name="world">哈哈哈哈</p>
    <h2 name="world">嘻嘻</h2>
    <span name="world">吼吼</span>
</body>
</html>